;Reply From: Bethel, David ;Date: Jun/19/00 - 19:41 (GMT) ; Re: Change attribute definition inside a block (defun c:ATAG (/ bname tdef fe ed tag tlist npmt) (while (or (not bname) (= bname "") (not (tblsearch "BLOCK" bname))) (setq bname (strcase (getstring "\nBlock Name: ")))) (setq tdef (tblsearch "BLOCK" bname)) (and (/= (logand (cdr (assoc 70 tdef)) 2) 2) (princ "\nBlock Contains No Attributes") (exit)) (setq fe (cdr (assoc -2 tdef))) (while fe (setq ed (entget fe)) (and (= (cdr (assoc 0 ed)) "ATTDEF") (setq tlist (cons (cdr (assoc 2 ed)) tlist))) (setq fe (entnext fe))) (prin1 tlist) (while (or (not tag) (not (member tag tlist))) (setq tag (strcase (getstring "\nTag To Change: ")))) (setq npmt (getstring T "\nNew Prompt: ")) (setq fe (cdr (assoc -2 tdef))) (entmake tdef) (while fe (setq ed (entget fe)) (if (not (and (assoc 2 ed) (= (cdr (assoc 0 ed)) "ATTDEF") (= (cdr (assoc 2 ed)) tag))) (entmake ed) (entmake (subst (cons 3 npmt) (assoc 3 ed) ed))) (setq fe (entnext fe))) (entmake '((0 . "ENDBLK"))) (prin1)) ;| ;Svend, ;This will redefine the block and change the prompt for all ATTDEFs ;with the selected name. Not tested real well. Use at your own risk! ;-David ; ;PS Jon F. will not like the use of (exit)